<html>
<head><meta charset="utf-8"><title>Run clippy in-tree · clippy · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/index.html">clippy</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Run.20clippy.20in-tree.html">Run clippy in-tree</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="215218859"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Run%20clippy%20in-tree/near/215218859" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Run.20clippy.20in-tree.html#215218859">(Nov 01 2020 at 00:33)</a>:</h4>
<p>Is there a way to run clippy in-tree, instead of using an out-of-tree build + rustup-toolchain-install master?</p>



<a name="215218901"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Run%20clippy%20in-tree/near/215218901" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Run.20clippy.20in-tree.html#215218901">(Nov 01 2020 at 00:34)</a>:</h4>
<p>context: miri would like to run in-tree: <a href="#narrow/stream/131828-t-compiler/topic/miri.20stage.202">https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/miri.20stage.202</a></p>



<a name="215252614"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Run%20clippy%20in-tree/near/215252614" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> flip1995 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Run.20clippy.20in-tree.html#215252614">(Nov 01 2020 at 17:05)</a>:</h4>
<p>Nope, I ran into the exact same problems like you (regarding sysroot and libllvm). But if you figured out how to do this with Miri, it would be great to also have this with clippy</p>



<a name="215260847"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Run%20clippy%20in-tree/near/215260847" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Run.20clippy.20in-tree.html#215260847">(Nov 01 2020 at 20:29)</a>:</h4>
<p>this is strange - <code>build src/tools/clippy</code> and <code>test src/tools/clippy</code> build different versions of clippy</p>
<div class="codehilite"><pre><span></span><code>$ x.py build src/tools/clippy --stage 0
Copying stage0 rustc from stage0 (x86_64-unknown-linux-gnu -&gt; x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Building stage0 tool clippy-driver (x86_64-unknown-linux-gnu)
   Compiling clippy v0.0.212 (/home/joshua/rustc/src/tools/clippy)
    Finished release [optimized] target(s) in 3.22s
Building stage0 tool cargo-clippy (x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.09s
$ x.py test src/tools/clippy --stage 0
Copying stage0 rustc from stage0 (x86_64-unknown-linux-gnu -&gt; x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Building stage0 tool clippy-driver (x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 0.09s
   Compiling getopts v0.2.21
   Compiling derive-new v0.5.8
   Compiling term v0.6.1
   Compiling rustfix v0.5.1
   Compiling clippy v0.0.212 (/home/joshua/rustc/src/tools/clippy)
   Compiling tester v0.7.0
   Compiling compiletest_rs v0.5.0
^C  Building [================================================&gt;      ] 107/120: tester, rustfix,...
</code></pre></div>



<a name="215260912"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Run%20clippy%20in-tree/near/215260912" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Run.20clippy.20in-tree.html#215260912">(Nov 01 2020 at 20:30)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/master/src/bootstrap/test.rs#L528">https://github.com/rust-lang/rust/blob/master/src/bootstrap/test.rs#L528</a> is the relevant  bit  Ithink</p>



<a name="215260929"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Run%20clippy%20in-tree/near/215260929" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Run.20clippy.20in-tree.html#215260929">(Nov 01 2020 at 20:30)</a>:</h4>
<p>oh boo and tests don't work at all either, this is the same thing I hit with miri yesterday</p>
<div class="codehilite"><pre><span></span><code>---- compile_test stdout ----
thread &#39;compile_test&#39; panicked at &#39;Found multiple rlibs for crate `serde`: `&quot;/home/joshua/rustc/build/x86_64-unknown-linux-gnu/stage0-tools/x86_64-unknown-linux-gnu/release/deps/libserde-0cbb27a77c795012.rlib&quot;` and `&quot;/home/joshua/rustc/build/x86_64-unknown-linux-gnu/stage0-tools/x86_64-unknown-linux-gnu/release/deps/libserde-d748cd52d3612bbb.rlib&quot;&#39;, src/tools/clippy/tests/compile-test.rs:46:25
</code></pre></div>



<a name="215261034"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Run%20clippy%20in-tree/near/215261034" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Run.20clippy.20in-tree.html#215261034">(Nov 01 2020 at 20:33)</a>:</h4>
<p><span class="user-mention" data-user-id="116122">@simulacrum</span> do you happen to know what's going on here?</p>



<a name="215261132"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/Run%20clippy%20in-tree/near/215261132" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/Run.20clippy.20in-tree.html#215261132">(Nov 01 2020 at 20:35)</a>:</h4>
<p>(I think I want to start with clippy because it has a considerably less cursed build process than miri)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>